package algorithm.tic_tac_toe;

import junit.framework.Assert;

import org.junit.Test;

public class ChessBoardTest {
	@Test
	public void test5() {
		ChessBoard cb = new ChessBoard();

		cb.setChessComputer(0, 1);
		cb.setChessComputer(1, 1);
		cb.setChessComputer(1, 0);

		Assert.assertEquals(cb.checkPlayerWin(ChessBoard.COMPUTER), false);
	}

	@Test
	public void test4() {
		ChessBoard cb = new ChessBoard();

		cb.setChessComputer(0, 1);
		cb.setChessComputer(1, 1);
		cb.setChessComputer(1, 2);

		Assert.assertEquals(cb.checkPlayerWin(ChessBoard.COMPUTER), false);
	}

	@Test
	public void test3() {
		ChessBoard cb = new ChessBoard();

		cb.setChessComputer(0, 1);
		cb.setChessComputer(1, 1);
		cb.setChessComputer(2, 1);

		Assert.assertEquals(cb.checkPlayerWin(ChessBoard.COMPUTER), true);
	}

	@Test
	public void test2() {
		ChessBoard cb = new ChessBoard();

		cb.setChessComputer(0, 2);
		cb.setChessComputer(1, 1);
		cb.setChessComputer(2, 0);

		Assert.assertEquals(cb.checkPlayerWin(ChessBoard.COMPUTER), true);
	}

	@Test
	public void test1() {
		ChessBoard cb = new ChessBoard();

		cb.setChessComputer(0, 0);
		cb.setChessComputer(0, 1);
		cb.setChessComputer(2, 2);
		cb.setChessComputer(1, 1);
		cb.setChessComputer(1, 2);

		Assert.assertEquals(cb.checkPlayerWin(ChessBoard.COMPUTER), true);
	}
}
